import { useState } from "react";
import Son from "./son";
function FatherComponents() {
  const [count, setCount] = useState(0);
  const handleClick = () => {
    setCount(count + 1);
  };
  const getCount = function (playload) {
    setCount(playload);
  };
  return (
    <div className="list">
      父组件的count值为--{count}
      <button onClick={handleClick}>父组件++++1</button>
      <Son
        count={count}
        name={"这可是"}
        age={18}
        fn={() => {
          console.log("我是父组件的函数");
        }}
        zks={<span>我是span</span>}
        onEmitzksCount={getCount}
        children={"可以不适用闭合标签"}
      >
        这是一个特殊的props的key放到了children中
        <span>使用双标签传递的数据会被放到child中_zks</span>
      </Son>
    </div>
  );
}

export default FatherComponents;
